package com.xxbb.chapter_3.dome3_instance;


public class Programma {
	//单例模式
	public static void main(String[] args) {
		Common common= Common.getInstance();
		common.setName("张三");
		System.out.println("对象1："+common.getName());
		Common common2=Common.getInstance();
		System.out.println("对象2："+common2.getName());
		if(common == common2){
			System.out.println("两者相等！");
		}else {
			System.out.println("不相等");
		}
	}
}
